package com.itheima.list;

import java.util.LinkedList;

/*
LinkedList
特有方法
 */
public class Demo03 {

    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();

        list.add("坤坤");
        list.add("签签");
        list.add("滔滔");
        list.add("鹿鹿");

        System.out.println(list);

        list.addFirst("晓彤");
        list.addLast("小璐");

        System.out.println(list);

        String s = list.removeFirst();
        String s2 = list.removeFirst();
        System.out.println(s);
        System.out.println(s2);
        System.out.println(list);
        String s1 = list.removeLast();
        System.out.println(s1);
        System.out.println(list);

        String first = list.getFirst();
        System.out.println(first);

        String first2 = list.getFirst();
        System.out.println(first2);


        System.out.println(list.getLast());
    }
}
